package com.zhiyou100.abstract_demo2;

/**
 * 白金卡
 */
public class PlatinumCard extends Card{

    public PlatinumCard() {
    }

    public PlatinumCard(String card_num, String password, double balance) {
        super(card_num, password, balance);
    }

    //支付
    @Override
    public void pay(double price) {
        double balance=getBalance();
        balance = balance - (price * 0.8);
        System.out.println("商品价格为:" + price + "\t" +
                "您支付了" + (price * 0.8) + "\t" +
                "卡内余额为" + balance);
        //将卡的余额更新下
        setBalance(balance);
    }
}
